use base type as hint when inferring#12284
Conversation
Would help with python#12268. Modified a test because the two behaviours conflict right now.
This comment has been minimized.
This comment has been minimized.
|
To motivate this PR, consider the following code (which is also a test case): from typing import Union, List
class A: pass
class B: pass
U = Union[A, B]
class Base:
variable1 : List[U] = []
variable2 : List[U] = []
class Derived(Base):
variable1 = [A()]
variable2 = variable1before this PR, although |
|
Note that this hinting is already done, in order to infer |
|
Since the issue is open, I think it's fair to say that this would fix #12268 |
|
Sorry for a bit of spam, normally I'd force push, I can't force github to link the issue, for some reason. |
|
I give up. Maybe a maintainer can help. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
|
Hey, I think this PR is ready for someone to look over. It's been around two weeks, and I don't want it to get lost in the sea of PRs. Does anyone mind taking a look? |
hauntsaninja
left a comment
There was a problem hiding this comment.
Thank you for the PR! I believe this was fixed in #13494
Would help with #12268. Modified a test because the two behaviours conflict right now.